<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3D变化</title>
  <style>
    .outer {
      width: 200px;
      height: 200px;
      border: 2px solid black;
      margin: 0 auto;
      margin-top: 100px;
      /* 开启3D空间 */
      transform-style: preserve-3d;
      /* 设置景深（有了透视效果，近大远小） */
      perspective: 500px;
      /* 设置透视点的位置 */
      perspective-origin: 100px 100px;
    }
    .inner {
      width: 200px;
      height: 200px;
      background-color: deepskyblue;
      transform: translateZ(200px);
    }
  </style>
</head>
<body>
  <!-- 
    3D变化外部盒子必须开启 3D 空间和景深，不然达不到理想的效果
    1. 3D空间与景深
      transform-style: preserve-3d：开启3D空间
      perspective: 500px;
    2. 3D透视点位置
      perspective-origin: 100px 100px;
    3. 3D位置
      transform: translateX(100px);
      transform: translateY(100px);
      transform: translateZ(150px);
      transform: translate3d(100px, 100px, 150px);
    4. 3D旋转
      transform: rotateX(45deg);
      transform: rotateY(45deg);
      transform: rotateZ(45deg);
      transform: rotate3d(1, 1, 1, 30deg);
    5. 3D缩放
      transform: scaleX(1.5);
      transform: scaleY(1.5);
      transform: scaleZ(1.5);
      transform: scale(1.5, 1.5, 1.5);
    6. 3D多重变换
      transform: translateZ(100px) scaleZ(3) rotateY(45deg);
    7. 背部
      backface-visibility: hidden;
   -->
  <div class="outer">
    <div class="inner">你好啊</div>
  </div>
</body>
</html>